public class DBItem implements Cloneable{
	public enum Type {
		DATABASE, TABLE, ROW;
	}

	public Type type;
	public String database;
	public String table;
	boolean tableSupported;
	public String name;

	public DBItem(Type type) {
		this.type = type;
	}

	boolean validate() {
		switch(type) {
			case ROW:
				return database != null && table != null && name != null;
			case TABLE:
				return database != null && table != null;
			case DATABASE:
				return database != null;
			default:
				return false; // Will this case really happen???
		}
	}

	public String toString() {
		return "DBItem {"
				+ "type: " + type==null ? "null" : type + ", "
				+ "Database Name: " + database + ", " 
				+ "Table Name: " + table + ", "
				+ "Name: " + name + "}";
	}

	public DBItem clone() {
		DBItem result = new DBItem(type);
		result.database = database;
		result.table = table;
		result.name = name;
		return result;
	}
}
